package Java网络编程.TCP通信程序练习.p6_多线程实现文件上传;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/*代码用线程封装，为每一个客户端创造一个线程*/
public class ServerDemo {

    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(2);

        while (true) {
            //监听客户端连接
            Socket s = ss.accept();
            //为每一个客户端开启线程
            new Thread(new ServerThread(s)).start();
        }
    }

}
